package cn.kgc.shiro03.util;

import java.util.Random;

/**
 * @author: mosin
 * @version: v1.0  2022/11/17
 */
public class SaltUtil {

    public static  String getSalt(int length){
        char[] chars = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890!@#$%^&&&&&&*();,.".toCharArray();
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < length; i++) {
            Random random = new Random();
            int randomNumber = random.nextInt(chars.length);
            sb.append(chars[randomNumber]);
        }
        return  sb.toString();
    }
}
